#!/usr/bin/env python
# -*- coding: utf-8 -*-

from src.database import (
    db,
    Model,
    SurrogatePK,
    relationship,
    ReferenceCol,
)
from src.models.record import Record


class Category(SurrogatePK, Model):
    __tablename__ = 'category'
    name = db.Column(db.String(40), nullable=False)
    description = db.Column(db.String(100), nullable=False)

    records = relationship(Record, backref=db.backref('category'))

    def __init__(self, **kwargs):
        db.Model.__init__(self, **kwargs)
